package xyz.heyaoshare.core.controller.system.dict.vo.req;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import xyz.heyaoshare.core.entity.system.DictType;
import xyz.heyaoshare.core.enums.system.dict.DictDataStatusEnum;
import xyz.heyaoshare.validation.validator.InEnum;

import java.io.Serial;
import java.io.Serializable;

import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;

/**
 * 更新字典数据请求对象
 * @author YueHe
 * @version 0.0.1
 * @since 2025/5/9 下午5:02
 */
@Data
@Schema(description = "更新字典数据请求对象")
public class DictDataUpdateReqVO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @NotNull(message = "数据ID不能为空")
    @Schema(description = "数据ID", requiredMode = REQUIRED)
    private Long id;

    /**
     * @see DictType#getId()
     */
    @NotNull(message = "字典类型ID不能为空")
    @Schema(description = "字典类型ID", requiredMode = REQUIRED)
    private Long dictTypeId;

    @Length(max = 50, message = "字典类型名称长度不能超过{max}字符")
    @NotBlank(message = "字典值不能为空")
    @Schema(description = "字典值", requiredMode = REQUIRED)
    private String value;

    @NotBlank(message = "字典标签不能为空")
    @Length(max = 50, message = "字典标签名称长度不能超过{max}字符")
    @Schema(description = "字典标签", requiredMode = REQUIRED)
    private String label;

    @Length(max = 50, message = "文本样式名称长度不能超过{max}字符")
    @Schema(description = "文本样式")
    private String style;

    @Schema(description = "排序")
    private Integer sort;

    @Length(max = 300, message = "备注长度不能超过{max}字符")
    @Schema(description = "备注")
    private String remark;

    @InEnum(value = DictDataStatusEnum.class, message = "状态值不正确")
    @Schema(description = "状态【1可用，不可用】")
    private Integer status;

}